/*******************************************************************************

	COPYRIGHT (C) LAB601, Southeast University
	----------------------------------------
	File Name:		PCI7600_dump.v
	Title:			PCI7600_dump
	Author:			Len D.
	Email:			neldon@gmail.com
	Revision:		1.0
	Date:			2009-10-31
	Description:	a) Write dump functions.
					b) Parse dump vars.
					c) Dump finish control.
	Other:			//
	----------------------------------------
	History
	----------
	Date		Rev		By			Description
	----------  ------	----------	----------------------------------------
	2009-10-31	1.0		Len D.		1) Initialized.
	
*******************************************************************************/
//-------------------- dump variable control ------------------//
// include file "PCI7600_dumpvars.v"
//-------------------- vvvvvvvvvvvvvvvvvvvvv ------------------//
initial
begin
	$fsdbDumpfile(`WAVEFILE);
	`include "PCI7600_dumpvars.v"
end
//-------------------- ^^^^^^^^^^^^^^^^^^^^^ ------------------//

//-------------------- dump finish control --------------------//
// Simulation will finish when frame counter reaches Preset in "PCI7600_io.v".
//-------------------- vvvvvvvvvvvvvvvvvvv --------------------//
parameter	DUMP_FRAME	= `FRAME;
parameter	DUMP_TIME	= `DUMPTIME;

integer	frame_cnter;		// frame number counter.
initial	frame_cnter = 0;
wire	trigger;			// frame trigger.
`ifdef GOLDEN
//assign	trigger = ;
`else
//assign	trigger = ;
`endif


// Determine end condition.
always @ ( negedge trigger )
begin
	if ( frame_cnter == DUMP_FRAME )
		$finish;
	else
		frame_cnter = frame_cnter + 1;
end

// or finished when timeout.
initial	#DUMP_TIME	$finish;
//-------------------- ^^^^^^^^^^^^^^^^^^^ --------------------//
